﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web.Routing;
using NHibernate;
using Mindfor.Web.Config;

namespace Mindfor.Web.Modules.System
{
	/// <summary>
	/// Contains controllers to configure WebMP.
	/// </summary>
	public class SystemModule : ModuleBase
	{
		public SystemModule()
		{
			IsAlwaysEnabled = true;
		}

		/// <summary>
		/// Called when all modules was registered.
		/// </summary>
		/// <param name="info">Registration data.</param>
		/// <param name="registeredModules">Registered modules.</param>
		public override void AfterRegister(ModuleRegistrationData info, ModuleBase[] registeredModules)
		{
			// not found
			info.Routes.MapRoute("PageNotFound", "{*path}",
				new { module = CmsConstants.SystemModuleName, controller = CmsConstants.SystemControllerName, action = CmsConstants.NotFoundActionName });

			base.AfterRegister(info, registeredModules);
		}
	}
}
